//
//  HttpRequest.h
//  Friendsback
//
//  Created by 宋质彬 on 2018/3/7.
//  Copyright © 2018年 宋质彬. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface HttpRequest : NSObject


/**
  判断网络状态
 */
+ (void)judgeNetworkStatusWithSuccess:(void(^_Nullable)(AFNetworkReachabilityStatus status))success;


/**
 get progress、

 @param URLString 短码
 @param parameters 参数
 @param progress 进度
 @param success 成功的回调
 @param failure 失败的回调
 */
+ (void)GET_PROGRESS:(NSString *_Nonnull)URLString
parameters:(id _Nullable )parameters
   progress:(void (^_Nullable)(NSProgress * _Nullable downloadProgress))progress
    success:(void(^_Nullable)(id _Nullable result,NSString * _Nullable successMessage))success
    failure:(void(^_Nullable)(NSInteger code,NSString * _Nullable errorMessage))failure;
//    errors:(void(^_Nullable)(NSError * _Nonnull error))errors;

/**
 post progress、
 
 @param URLString 短码
 @param parameters 参数
 @param progress 进度
 @param success 成功的回调
 @param failure 失败的回调
 */
+ (void)POST_PROGRESS:(NSString *_Nullable)URLString
 parameters:(id _Nullable )parameters
    progress:(void (^_Nullable)(NSProgress * _Nullable uploadProgress))progress
     success:(void(^_Nullable)(id _Nullable result,NSString * _Nullable successMessage))success
     failure:(void(^_Nullable)(NSInteger code,NSString * _Nullable errorMessage))failure;
//     errors:(void(^_Nullable)(NSError * _Nonnull error))errors;



/**
 GET

 @param URLString 短码
 @param parameters 参数
 @param success 成功的回调
 @param failure 失败的回调
 */
+ (void)GET:(NSString *_Nonnull)URLString
          parameters:(id _Nullable )parameters
             success:(void(^_Nullable)(id _Nullable result,NSString * _Nullable successMessage))success
             failure:(void(^_Nullable)(NSInteger code,NSString * _Nullable errorMessage))failure;


/**
 POST

 @param URLString 短码
 @param parameters 参数
 @param success 成功的回调
 @param failure 失败的回调
 */
+ (void)POST:(NSString *_Nullable)URLString
           parameters:(id _Nullable )parameters
              success:(void(^_Nullable)(id _Nullable result,NSString * _Nullable successMessage))success
              failure:(void(^_Nullable)(NSInteger code,NSString * _Nullable errorMessage))failure;


/**
 <#Description#>

 @param URLString 短码
 @param parameters 参数
 @param imagesArray 图片资源
 @param name 服务器文件名称
 @param fileName 图片文件名称
 @param mimeType 文件类型
 @param progress 上传进度
 @param success 成功的回调
 @param failure 失败的回调
 */
+ (void)UPLOAD_IMAGE:(NSString *_Nullable)URLString parameters:(NSDictionary*_Nullable)parameters imagesArray:(NSArray *_Nullable)imagesArray name:(NSString *_Nullable)name fileName:(NSString *_Nullable)fileName mimeType:(NSString *_Nullable)mimeType uploadProgress:(void(^_Nullable)( NSProgress * _Nonnull uploadProgress))progress
             success:(void(^_Nullable)(id _Nullable result,NSString * _Nullable successMessage))success
             failure:(void(^_Nullable)(NSInteger code,NSString * _Nullable errorMessage))failure;


/**
 <#Description#>

 @param URLString <#URLString description#>
 @param parameters <#parameters description#>
 @param success <#success description#>
 @param failure <#failure description#>
 */
+ (void)GET_ERROR:(NSString *_Nullable)URLString
       parameters:(id _Nullable )parameters
          success:(void(^_Nullable)(id _Nullable result))success
          failure:(void(^_Nullable)(NSError* _Nullable error))failure;


/**
 初始化配置接口，这个借口需要网络状态
 
 @param URLString URLString description
 @param parameters parameters description
 @param success success description
 @param failure failure description
 */
+ (void)POST:(NSString *)URLString
  parameters:(id)parameters
     success:(void(^)(id result,NSString *successMessage))success
     failure:(void(^)(NSInteger code,NSString *errorMessage))failure
      errors:(void(^)(NSError * _Nonnull error))errors;
@end
